package org.exhaust.barbecue.action;

import org.exhaust.barbecue.AbstractRequest;
import org.exhaust.barbecue.AbstractResponse;
import org.exhaust.barbecue.Action;
import org.exhaust.barbecue.ActionContext;

public abstract class AbstractValidatorAction<M extends AbstractRequest, N extends AbstractResponse> implements Action {

    @Override
    public boolean perform(AbstractRequest request, AbstractResponse response, ActionContext context) {
        validate((M) request, context);
        return true;
    }

    protected abstract void validate(M request, ActionContext context);

}
